package com.yipinhouse.employee.client;

import com.yipinhouse.common.result.Result;
import com.yipinhouse.employee.client.param.AddBrokerParam;
import com.yipinhouse.employee.client.param.OrderHouseParam;
import com.yipinhouse.employee.client.result.ShopBrokerInfoResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
* name是项目名，contextId是client的名字
*/
@FeignClient(contextId = "brokerInfoManageClient",name="employee")
public interface BrokerInfoManageClient {


    /**
     * 添加员工
     * @param param
     * @return
     */
    @PostMapping("addBroker")
    public Result addBroker(@RequestBody AddBrokerParam param);

    /**
     * 经纪人锁定房源
     * @param
     * @return
     */
    @PutMapping("/orderHouse")
    Result orderHouse(@RequestBody OrderHouseParam param);

    /**
     * 关联员工与门店
     * @param shopId
     * @param brokerId
     * @return
     */
    @GetMapping("correlation")
    Result correlation(@RequestParam("shopId") Integer shopId,
                       @RequestParam("brokerId") Integer brokerId);


    /**
     * 查询门店员工
     *
     * @param shopId
     * @return
     */
    @GetMapping("getBrokerByShopId")
    Result<List<ShopBrokerInfoResult>> getBrokerByShopId(Integer shopId);

}
